import {createStackNavigator} from 'react-navigation-stack';

import StackNavigatorConfig from './connfig/StackNavigatorConfig';

import MainTab from './MainTab/index';
import {
  Task,
  Integral,
  TimeDetail,
  CalculateForce,
  PaymentDetails,
  Assets,
  BaseInfoDetail,
  WGSInfoDetail,
  WESInfoDetail,
  WGSIncluded,
  WESIncluded,
  RegistrationRight,
  Feedback,
  JoinUs,
  Know,
  Settings,
  Message,
  MessageDetail,
  Login,
  Registered,
  Verification,
  ResetPwdUserName,
  ResetPwdCode,
  ResetPwd,
  PrivacyAgreement,
  UserAgreement,
  AuthLoading,
  BrokenNet,
  Scanning,
  Trading,
  TradingThan,
  VerificaCode,
  ToReset,
  ForgetPwd,
  TradingPwd,
  TradingthanPwd,
  Withdrawal,
  WalletAddres,
  AddressThe,
  DealDetailsdls,
  TheOrderDetails,
  ForgetUsernames,
  RetrieveName,
  ApplyDetail,
  ApplyPage,
  ApplySiteList,
  Report,
  Redbag,
} from 'screen/index';

import {
  Invitation,
  BasicInformation,
  Information,
  QRCode,
  SignIn,
  Strategy,
  Wgs,
  Wes,
  WesCollectionProcess,
  Activate,
  Myscene,
  Incentive,
} from 'tasks/index';

import {
  MarketTest,
  CalculationHistory,
  CalculationPower,
  TokenLog,
  MarketMain,
  ActivityDetail,
} from '../Market/index';

import {
  MainInterface,
  LaunchProposals,
  SpecityExecytiveDirector,
  AboutCommunity,
  History,
  ProposalInformation,
  ProposalList,
  PDFInfo,
  Announcement,
} from '../Proposal/index';

import {
  MineIndex,
  UserInfo,
  CompanyInfo,
  EditUserInfo,
  EditCompanyInfo,
  Code,
  ChargeAddress,
  Giving,
  CaseBook,
  AddCase,
  ShowOtherInfo,
} from '../Mine/index';
import {HeaderLeft, HeaderRight} from '../components';
import React from 'react';

const RootRouter = {
  AuthLoading: {
    screen: AuthLoading,
    navigationOptions: () => ({
      header: null,
      gesturesEnable: false,
    }),
  },
  Login: {
    screen: Login,
    navigationOptions: () => ({
      header: null,
      gesturesEnable: false,
    }),
  },
  Registered: {
    screen: Registered,
    navigationOptions: () => ({
      header: null,
      gesturesEnable: false,
    }),
  },
  Verification: {
    screen: Verification,
    navigationOptions: () => ({
      header: null,
      gesturesEnable: false,
    }),
  },
  ResetPwdUserName: {
    screen: ResetPwdUserName,
    navigationOptions: () => ({
      title: '修改密码',
    }),
  },
  ResetPwdCode: {
    screen: ResetPwdCode,
    navigationOptions: () => ({
      title: '修改密码',
    }),
  },
  ResetPwd: {
    screen: ResetPwd,
    navigationOptions: () => ({
      title: '修改密码',
    }),
  },
  PrivacyAgreement: {
    screen: PrivacyAgreement,
    navigationOptions: () => ({
      title: '隐私协议',
    }),
  },
  UserAgreement: {
    screen: UserAgreement,
    navigationOptions: () => ({
      title: '用户协议',
    }),
  },
  BrokenNet: {
    screen: BrokenNet,
    navigationOptions: () => ({
      header: null,
    }),
  },
  MainTab: {
    screen: MainTab,
    navigationOptions: () => ({
      header: null,
    }),
  },
  Task: {
    screen: Task,
    navigationOptions: () => ({
      title: '算力加速',
    }),
  },
  Invitation: {
    screen: Invitation,
  },
  BasicInformation: {
    // 基础信息
    screen: BasicInformation,
    navigationOptions: () => ({
      title: '基础信息',
    }),
  },
  Information: {
    // 我的基础信息
    screen: Information,
    navigationOptions: () => ({
      title: '基础信息',
    }),
  },
  QRCode: {
    screen: QRCode,
    navigationOptions: () => ({
      header: null,
    }),
  },
  SignIn: {
    screen: SignIn,
    navigationOptions: () => ({
      title: '每日签到',
    }),
  },
  Strategy: {
    screen: Strategy,
    navigationOptions: () => ({
      title: '攻略',
    }),
  },
  Activate: {
    screen: Activate,
    navigationOptions: () => ({
      title: '激活邀请码',
    }),
  },
  Integral: {
    screen: Integral,
    navigationOptions: () => ({
      title: 'HGBC碱基',
    }),
  },
  TimeDetail: {
    screen: TimeDetail,
    navigationOptions: () => ({
      title: '碱基销毁说明',
    }),
  },
  Wgs: {
    screen: Wgs,
    navigationOptions: () => ({
      header: null,
    }),
  },
  Wes: {
    // 全外显子
    screen: Wes,
    navigationOptions: () => ({
      header: null,
    }),
  },
  WesCollectionProcess: {
    screen: WesCollectionProcess,
    navigationOptions: () => ({
      title: '数据收录流程',
    }),
  },
  Myscene: {
    screen: Myscene,
    navigationOptions: () => ({
      title: '基因组数据',
    }),
  },
  CalculateForce: {
    screen: CalculateForce,
    navigationOptions: () => ({
      title: '算力',
    }),
  },
  PaymentDetails: {
    screen: PaymentDetails,
  },
  Assets: {
    screen: Assets,
  },
  BaseInfoDetail: {
    // 我的基础信息
    screen: BaseInfoDetail,
    navigationOptions: () => ({
      title: '我的基础信息',
    }),
  },
  WGSInfoDetail: {
    // 基因组数据
    screen: WGSInfoDetail,
    navigationOptions: () => ({
      title: '基因组数据',
    }),
  },
  WESInfoDetail: {
    // 全外显子组数据
    screen: WESInfoDetail,
    navigationOptions: () => ({
      title: '全外显子组数据',
    }),
  },
  WGSIncluded: {
    // 基因组数据
    screen: WGSIncluded,
    navigationOptions: () => ({
      title: '基因组数据',
    }),
  },
  WESIncluded: {
    // 全外显子组数据
    screen: WESIncluded,
    navigationOptions: () => ({
      title: '全外显子组数据',
    }),
  },
  RegistrationRight: {
    // 数据确权
    screen: RegistrationRight,
    navigationOptions: () => ({
      title: '上链确权',
    }),
  },
  Feedback: {
    screen: Feedback,
    navigationOptions: () => ({
      title: '问题反馈',
    }),
  },
  JoinUs: {
    screen: JoinUs,
    navigationOptions: () => ({
      title: '加入我们',
    }),
  },
  Know: {
    screen: Know,
    navigationOptions: () => ({
      title: '认识星球',
    }),
  },
  Settings: {
    screen: Settings,
    navigationOptions: () => ({
      title: '账户设置',
    }),
  },
  Message: {
    screen: Message,
    navigationOptions: () => ({
      title: '消息',
    }),
  },
  MessageDetail: {
    screen: MessageDetail,
    navigationOptions: () => ({
      title: '消息详情',
    }),
  },
  Scanning: {
    screen: Scanning,
    navigationOptions: () => ({
      title: '扫描',
    }),
  },
  Incentive: {
    screen: Incentive,
    navigationOptions: () => ({
      title: '测序早鸟计划',
    }),
  },
  Trading: {
    screen: Trading,
    navigationOptions: () => ({
      title: '设置交易密码',
    }),
  },
  TradingThan: {
    screen: TradingThan,
    navigationOptions: () => ({
      title: '设置交易密码',
    }),
  },
  VerificaCode: {
    screen: VerificaCode,
    navigationOptions: () => ({
      title: '设置交易密码',
    }),
  },
  ToReset: {
    screen: ToReset,
    navigationOptions: () => ({
      title: '重置交易密码',
    }),
  },
  ForgetPwd: {
    screen: ForgetPwd,
    navigationOptions: () => ({
      title: '重置交易密码',
    }),
  },
  TradingPwd: {
    screen: TradingPwd,
    navigationOptions: () => ({
      title: '忘记交易密码',
    }),
  },
  TradingthanPwd: {
    screen: TradingthanPwd,
    navigationOptions: () => ({
      title: '忘记交易密码',
    }),
  },
  Withdrawal: {
    screen: Withdrawal,
    navigationOptions: () => ({
      title: null,
    }),
  },
  WalletAddres: {
    screen: WalletAddres,
    navigationOptions: () => ({
      header: null,
    }),
  },
  AddressThe: {
    screen: AddressThe,
    navigationOptions: () => ({
      title: null,
    }),
  },
  DealDetailsdls: {
    screen: DealDetailsdls,
    navigationOptions: () => ({
      title: '订单状态',
    }),
  },
  TheOrderDetails: {
    screen: TheOrderDetails,
    navigationOptions: () => ({
      title: '提现订单',
    }),
  },
  ForgetUsernames: {
    screen: ForgetUsernames,
    navigationOptions: () => ({
      title: '找回用户名',
    }),
  },
  RetrieveName: {
    screen: RetrieveName,
    navigationOptions: () => ({
      title: '找回用户名',
    }),
  },
  ApplyDetail: {
    screen: ApplyDetail,
  },
  ApplySiteList: {
    screen: ApplySiteList,
    navigationOptions: () => ({
      title: '位点信息列表',
    }),
  },
  ApplyPage: {
    screen: ApplyPage,
  },
  Report: {
    screen: Report,
    navigationOptions: () => ({
      title: '报告',
    }),
  },
  Redbag: {
    screen: Redbag,
    navigationOptions: () => ({
      title: '碱基拼手气红包',
    }),
  },
  //营销部分页面
  MarketTest: {
    screen: MarketTest,
    navigationOptions: () => ({
      title: '营销测试',
    }),
  },
  MarketMain: {
    screen: MarketMain,
    navigationOptions: () => ({
      title: '赚碱基',
    }),
  },
  CalculationHistory: {
    screen: CalculationHistory,
    navigationOptions: () => ({
      title: '算力记录',
    }),
  },
  CalculationPower: {
    screen: CalculationPower,
    navigationOptions: () => ({
      title: '算力',
    }),
  },
  TokenLog: {
    screen: TokenLog,
    navigationOptions: () => ({
      title: '碱基',
    }),
  },
  ActivityDetail: {
    screen: ActivityDetail,
    navigationOptions: () => ({
      title: '活动详情',
    }),
  },

  //治理部分
  HGBCSheQuZhiLi: {
    screen: MainInterface,
    navigationOptions: () => ({
      title: 'HGBC社区治理',
    }),
  },
  Second: {
    screen: LaunchProposals,
    navigationOptions: () => ({
      title: '发起提案',
    }),
  },
  Specify: {
    screen: SpecityExecytiveDirector,
    navigationOptions: () => ({
      title: '指明执行董事',
    }),
  },
  History: {
    screen: History,
    navigationOptions: () => ({
      title: '提案历史记录',
    }),
  },
  ProposalDetail: {
    screen: ProposalInformation,
    navigationOptions: () => ({
      title: '提案详情',
    }),
  },
  ProposalList: {
    screen: ProposalList,
    navigationOptions: () => ({
      title: '提案列表',
    }),
  },
  AboutCommunity: {
    screen: AboutCommunity,
    navigationOptions: () => ({
      title: '社区公告',
    }),
  },
  ProposalInformation: {
    screen: ProposalInformation,
    navigationOptions: () => ({
      title: '提案信息',
    }),
  },
  MineIndex: {
    screen: MineIndex,
    navigationOptions: () => ({
      title: '主页',
    }),
  },
  PDFInfo: {
    screen: PDFInfo,
    navigationOptions: () => ({
      title: '资料查看',
    }),
  },
  Announcement: {
    screen: Announcement,
    navigationOptions: () => ({
      title: '社区公告',
    }),
  },
  //  我的部分
  UserInfo: {
    screen: UserInfo,
    navigationOptions: () => ({
      title: '用户简介',
    }),
  },
  CompanyInfo: {
    screen: CompanyInfo,
    navigationOptions: () => ({
      title: '用户简介',
    }),
  },
  EditUserInfo: {
    screen: EditUserInfo,
    navigationOptions: () => ({
      title: '编辑简历',
    }),
  },
  EditCompanyInfo: {
    screen: EditCompanyInfo,
    navigationOptions: () => ({
      title: '编辑简历',
    }),
  },
  Code: {
    screen: Code,
    navigationOptions: () => ({
      title: '扫码',
    }),
  },
  ChargeAddress: {
    screen: ChargeAddress,
    navigationOptions: () => ({
      title: '充值',
    }),
  },
  Giving: {
    screen: Giving,
    navigationOptions: () => ({
      title: '转赠',
    }),
  },
  CaseBook: {
    screen: CaseBook,
    navigationOptions: () => ({
      title: '爱心病历本',
    }),
  },
  AddCase: {
    screen: AddCase,
    navigationOptions: () => ({
      title: '添加病例',
    }),
  },
  ShowOtherInfo: {
    screen: ShowOtherInfo,
    navigationOptions: () => ({
      title: '用户介绍',
    }),
  },
};

const config = {
  navigationOptions: ({navigation}) => ({
    headerStyle: {
      backgroundColor: '#fff',
      borderBottomWidth: 0,
      height: 44,
      elevation: 0,
    },
    headerTitleStyle: {
      flex: 1,
      textAlign: 'center',
      color: '#333',
      fontSize: 17,
      fontWeight: '400',
    },
    headerLeft: <HeaderLeft triggerBack={() => navigation.goBack()} />,
    headerRight: <HeaderRight />,
    headerBackTitle: null,
  }),
  initialRouteName: 'AuthLoading',
};
export default createStackNavigator(
  RootRouter,
  // StackNavigatorConfig({initialRouteName: 'AuthLoading'}),
  {
    initialRouteName: 'AuthLoading',
    defaultNavigationOptions: ({navigation}) => ({
      headerStyle: {
        backgroundColor: '#fff',
        borderBottomWidth: 0,
        height: 44,
        elevation: 0,
      },
      headerTitleStyle: {
        flex: 1,
        textAlign: 'center',
        color: '#333',
        fontSize: 17,
        fontWeight: '400',
      },
      headerLeft: <HeaderLeft triggerBack={() => navigation.goBack()} />,
      headerRight: <HeaderRight />,
      headerBackTitle: null,
    }),
  },
);
